<?php

/**
 * Description of PlusDate
 *
 * @author anhducbkhn
 * @since Sep 23, 2013 - 12:00:40 PM
 */
class PlusDate
{

    /**
     * 
     * @param int $crr_date
     * @param int $interval_day numbers of day 
     * @param boolean $isTimeStamp <b>TRUE</b> if $crr_date is textual of <b>FALSE</b> if timestamp
     * @return int TimStamp
     */
    public static function plusDateByInterval($crr_date, $interval_day, $isTimeStamp = TRUE)
    {

        if ($isTimeStamp)
        {
            $time = $crr_date;
        }
        else
        {
            $time = date('m/d/Y', $crr_date);
        }

        $date = new DateTime($time);
        $date->add(new DateInterval('P' . $interval_day . 'D'));

        return $date->getTimestamp();
    }

}

/** 
 * End file PlusDate
 */
